package com.genericity.demo02;

import java.util.Random;

public class Test02 {
    public static void main(String[] args) {
        //System.out.println("泛型类的使用");
        Random random = new Random();
        System.out.println(random.nextInt(99998));
        System.out.println("========");

        // 抽奖品
        GetProducts<String> strProducts = new GetProducts<>();
        // 奖品组
        String[] product = {"苹果手机","Ipad","华为手机","小米电视","扫地机器人"};
        // 添加奖金
        for (int i = 0; i < product.length; i++) {
            strProducts.setProduct(product[i]);
        }
        // 随机抽取奖品
        System.out.println("恭喜你，抽中了奖品："+strProducts.getProduct());

        System.out.println("=====抽取现金====");
        GetProducts<Integer> intGetProducts = new GetProducts<>();
        Integer[] money = {100,200,500,3000,1000};
        // 添加现金设置
        for (int i = 0; i < money.length; i++) {
            intGetProducts.setProduct(money[i]);
        }
        // 抽取现金红包
        System.out.println("恭喜你抽中了现金红包："+intGetProducts.getProduct());
    }
}
